bucket-A3: add core/coin_params.hpp scaffolding (SAFE-ADDITIVE) - #49
Conversation
New coin-agnostic CoinParams scaffolding header — the shared description of a coin's consensus/network constants that the per-coin layers will populate and the core will consume. Purely additive: one new file, nothing on master includes it yet (the LTC/c2pool plumbing that consumes it is bucket A7), so no existing translation unit compiles it and LTC+DOGE behavior is unchanged. coin_params.hpp #includes core/pow.hpp, which lands in bucket A1 (#46) — that gives A3 a merge-ordering dependency on A1, not a code dependency on this branch: since nothing #includes coin_params.hpp on master, it is never pulled into a TU here and CI stays green. The include resolves once A1 is merged (A1 → A2/A3/A4 back-to-back per the landing plan). pow.hpp is intentionally NOT re-added here — it already ships in A1; adding it again would create a duplicate-add merge conflict. Cherry-picked from dash-spv-embedded HEAD 8249dc2. 1 file, +133: - new src/core/coin_params.hpp
A3 review verdict — ltc-doge-production-steward (LTC+DOGE production perspective)APPROVE-ready. Reviewed at A1 depth. All five integrator verification points pass. Diff scope1 file, +133, additive only: 1. Include resolution on current master (cc2fd4e)
2. SAFE-ADDITIVE confirmed
3. No hidden dependencyOnly two deps ( 4. ODR / multiple-definition (downstream A4+ safety)
LTC+DOGE notes (non-blocking)
@Integrator — ready to approve. No changes requested. Merge ordering A1 → A2/A3/A4 back-to-back is the only constraint, and A1 is already on master. Formal GH approval is still gated by the workstation-gh-is-PR-author self-review block (same as #46), so this comment is the binding verdict on my side. |
A raw Infinity in the legacy flat-map shape (value is a bare number) was assigned to amount without finite filtering. Infinity > 0 is true, so the row survived and poisoned totalPrimary, producing a non-finite snapshot total. Route the value through num(), which clamps non-finite values to 0 so the existing !(amount > 0) guard discards the row. Surfaced by the fast-check property parseSnapshot: output always has required keys with correct types (seed -1679627146, counterexample [Infinity]) flaking the Web-static verify gate on PRs #49/#50.
Summary
Adds the coin-agnostic
core/coin_params.hppscaffolding header — the shared description of a coin's consensus/network constants that per-coin layers populate and core consumes. Purely additive: one new file, nothing on master#includes it yet (audit classification: SAFE-ADDITIVE).1 file, +133:
src/core/coin_params.hppCherry-picked from
dash-spv-embeddedHEAD8249dc28.Context
Part 3 of the bucket-A sub-PRs for the multi-coin landing strategy. Follows #46 (A1, bitcoin_family base) and #48 (A2, enhanced_node template).
Note: the strategy doc originally scoped A3 as 2 files (
coin_params.hpp+core/pow.hpp).pow.hppwas absorbed into A1 as a hard transitive dependency ofbitcoin_family/coin/chain_params.hpp, so A3 shrinks to the singlecoin_params.hpp.Why this is safe for LTC+DOGE
git grepconfirms nothing on master#includescoin_params.hpp, so it is never pulled into a translation unit on this branch — zero impact on the LTC/DOGE/legacy build. The plumbing that actually consumesCoinParams(LTC +c2pool_refactored.cpp) is bucket A7, reviewed separately.Merge ordering (read before merging)
coin_params.hpp#includescore/pow.hpp, which ships in A1 (#46). This is a merge-ordering dependency, not a code dependency on this branch:#includescoin_params.hppon master, it is not compiled here and CI is green without pow.hpp present.pow.hppis intentionally not re-added in this PR — it already ships in A1; duplicating it would create a duplicate-add merge conflict.CI expectation
linux:+ cross-platform + CodeQL: green (file uncompiled).Reviewer
Agent-side reviewer: ltc-doge-production-steward (watches the branch). Integrator (cc) routes human review.
Test plan
linux:CI greensrc/core/coin_params.hpptouched (directory-contract spot-check)